package com.jeff.tianti.cms.entity;

import com.jeff.tianti.common.entity.BaseEntity;
import com.jeff.tianti.common.entity.MysqlSequenceIdEntity;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "constitution")
public class Constitution extends BaseEntity implements Serializable {
    private String title;
    private String description;
    private String columnId;
    private String constitutionCateName;
    private ColumnInfo columnInfo;
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
    @Column(name = "column_id")
    public String getColumnId() {
        return columnId;
    }

    public void setColumnId(String columnId) {
        this.columnId = columnId;
    }
    @Transient
    public String getConstitutionCateName() {
        return constitutionCateName;
    }

    public void setConstitutionCateName(String constitutionCateName) {
        this.constitutionCateName = constitutionCateName;
    }

    @ManyToOne(fetch = FetchType.LAZY,optional = false)//懒加载，不确保关联id能查询得到数据
    @JoinColumn(name = "column_id", updatable = false, insertable = false)
    public ColumnInfo getColumnInfo() {
        return columnInfo;
    }

    public void setColumnInfo(ColumnInfo columnInfo) {
        this.columnInfo = columnInfo;
    }
}
